home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_torchlight.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  105 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_torchlight.cog
  4. #
  5. # [SXC]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message        startup
  14. message        activated
  15. message        timer
  16.  
  17. thing        torchobj                                # the thing you light
  18. thing        flamepos                        nolink    # ghostobject for the position of the flame
  19. thing        player                            local
  20.  
  21. template    flametemplate                            # template for the flame
  22.  
  23. keyframe    litit=in_light_stuff.key        local
  24.  
  25. sound        burning=gen_torch_burnin_c.wav  local
  26.  
  27. flex        rvalmin=0.87
  28. flex        gvalmin=0.55
  29. flex        bvalmin=0.06
  30.  
  31. flex        rvalmax=0.89
  32. flex        gvalmax=0.64
  33. flex        bvalmax=0.3
  34.  
  35. flex        flickertime=2
  36. flex        lituptime=0.5
  37. flex        maxradius=0.3
  38. flex        minradius=0.3
  39. flex        radius=0.3                        local
  40.  
  41. int            islit=0
  42. int            lit=0                            local
  43.  
  44. vector        minlite                            local
  45. vector        maxlite                            local
  46. vector        zerolite                        local
  47.  
  48. end
  49.  
  50. # ========================================================================================
  51.  
  52. code
  53.  
  54. startup:
  55.     player = GetLocalPlayerThing();
  56.  
  57.     minlite = VectorSet(rvalmin, gvalmin, bvalmin);
  58.     maxlite = VectorSet(rvalmax, gvalmax, bvalmax);
  59.     zerolite= VectorSet(0.0, 0.0, 0.0);
  60.     SetThingLight(torchobj, zerolite, radius, 0.1);
  61.     if (islit == 1)
  62.     {
  63.         SetTimer(0.5);
  64.         CreateThing(flametemplate, flamepos);
  65.         SetThingLight(torchobj, minlite, radius, lituptime);
  66.         lit = 1;
  67.     }
  68.     return;
  69.  
  70. # ........................................................................................
  71. activated:
  72.     if (lit == 0)
  73.     {
  74.         if (GetCurWeapon(player) != 13) return;
  75.         if (GetSenderRef() != torchobj) return;
  76.  
  77.         lit = 1;
  78.  
  79.         SetActorFlags(player, 0x200000);
  80.         StopThing(player);
  81.         StartCutscene(0);
  82.  
  83.         PlayKey(player, litit, 4, 0x12, 0);
  84.         Sleep(0.4);
  85.         CreateThing(flametemplate, flamepos);
  86.         SetThingLight(torchobj, minlite, radius, lituptime);
  87.         SetTimer(lituptime);
  88.     }
  89.     return;
  90.  
  91. # ........................................................................................
  92. timer:
  93.     if (lit == 1)
  94.     {
  95.         lit = 2;
  96.         ThingLightAnim(torchobj, minlite, minradius, maxlite, maxradius, flickertime);
  97.         PlaySoundThing(burning, torchobj, 1, 3, 10, 1);
  98.         Sleep(0.7); # RT: Don't enable before anium is finished!
  99.         ClearActorFlags(player, 0x200000);
  100.         EndCutscene();
  101.     }
  102.     return;
  103.  
  104. end
  105.